package com.itheima.day11.charstream.test7;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        // 创建字符缓冲输入流
        BufferedWriter bw = new BufferedWriter(new FileWriter("myCode\\src\\com\\itheima\\day11\\b.txt"));

        // 写数据
        bw.write(97);
        bw.write("\r\n");

        char[] chars = {97, 98, 99, 100, 101};
        bw.write(chars);
        bw.newLine();

        bw.write(chars, 2, 3);
        bw.write("\r\n");

        bw.write("如果这都不算爱，我有什么好悲哀");
        bw.write("\r\n");

        String str = "如果这都不算爱，我有什么好悲哀";
        bw.write(str,2,5);

        // 释放资源
        bw.flush();
        bw.close();
    }
}
